/*
 * 〈描述〉
 *
 * @author Think
 * @since 版本号
 */

package com.duyj.rule.drools.unit;

import com.duyj.rule.model.dto.UserDTO;
import org.drools.ruleunit.DataSource;
import org.drools.ruleunit.RuleUnit;

/**
 * 〈一句话功能简述〉
 *
 * <p>〈功能详细描述〉
 *
 * @author Think
 * @since 版本号
 */
public class ScopeUnit implements RuleUnit {
    private int scopeAge;
    private DataSource<UserDTO> persons;

    public ScopeUnit() {
    }

    public ScopeUnit(DataSource<UserDTO> persons, int age) {
        this.persons = persons;
        this.scopeAge = age;
    }

    // A DataSource of Persons in this rule unit
    public DataSource<UserDTO> getPersons() {
        return persons;
    }

    // A global variable valid in this rule unit
    public int getScopeAge() {
        return scopeAge;
    }

    // --- life cycle methods
    @Override
    public void onStart() {
        System.out.println("AdultUnit started.");
    }

    @Override
    public void onEnd() {
        System.out.println("AdultUnit ended.");
    }
}
